1. Field of the Invention
The present invention relates to a numerical controller, and especially relates to a numerical controller which is capable of performing batch backup of memory areas even in the case where abnormality occurs in an unused memory area.
2. Description of the Related Art
An example of a numerical controller according to a prior art technique will be described with reference to FIG. 7.
In a numerical controller 1, a memory which stores setting information for controlling a machine, a machining program of a user, tool management information, and the like is incorporated. Rewriting is frequently performed with respect to these data which are stored in the memory, so that these data are stored in a volatile memory 11 such as an SRAM to be used in many cases. However, data in the volatile memory 11 will be lost unless power is kept to be supplied, so that a data retention battery or the like is connected so as to retain the data. Further, these data are often backed up in an external memory 2 such as a compact flash (registered trademark), a USB memory, and an SD card via an interface 14 in case the data stored in the volatile memory 11 are broken (refer to Japanese Patent No. 5398551 (JP 5398551, B), for example).
As for the backup, there is a method in which data such as a machining program and tool management information are backed up respectively in the form of files. However, when the number of files becomes large, the backup operation and management of backed-up files become burdensome. Therefore, a method in which all memory areas are collectively backed up is employed.
FIG. 8 is a flowchart illustrating a flow of processing for collectively backing up data stored in memory areas by the numerical controller 1.
In batch backup processing for memory areas, data are sequentially read out from the volatile memory 11 (step SC01) under the control of a central processing unit (CPU) 10, and when there is no abnormality in data which is read out (step SC02), the data which is read out is written in an external memory (step SC03). Then, when the reading and the writing of data of the whole memory area are completed (steps SC04 and SC05), this backup processing is ended.
FIG. 9 illustrates a general outline of memory backup processing performed by the numerical controller 1.
In the method for collectively backing up memory areas of the volatile memory 11, the CPU 10 reads out data from a head address of the memory area in a sequential order and writes the data in an external memory 2 for backup through error check performed by a detection circuit 13. Files formed in the external memory 2 are unified in every backup, so that an operation in the backup and management of backed-up data are easily performed compared to backup for each file of data stored in a memory.
On the other hand, these data are important for a correct operation of the numerical controller 1. If abnormality is found in these data, it is necessary to immediately stop processing and issue an alarm representing the abnormality so that the numerical controller 1 does not operate in an abnormal manner. Examples of a cause of an occurrence of data abnormality include a case where data held in the memory is broken due to voltage drop of the above-mentioned data retention battery, a noise, a software error, and the like, a case where transfer data becomes abnormal when a bus is influenced by a noise, a software error, and the like in transfer, and the like.
A memory and a bus have a function for detecting data abnormality such as parity and ECC so as to detect abnormality of data and data check is performed in reading of data from the memory or in transfer of data (to the bus). If abnormality is recognized, an alarm is issued and processing is stopped.
The above-mentioned function for detecting abnormality of data is operated in backup and when abnormality of data is detected, an alarm is issued and processing is stopped.
The method for collectively backing up a memory facilitates an operation and management of backup data because files can be unified. However, all areas of the memory are backed up in this method, so that an invalid area which is not used in a normal operation is also included in an object of the backup. However, the above-mentioned function for detecting abnormality of data is always executed in reading of data. Therefore, abnormality is detected also in the case where there is abnormality of data in the above-mentioned invalid area, and processing is stopped. That is, when data in an area irrelevant to an actual operation is broken, backup for valid data is not completed in a normal manner.
FIG. 10 illustrates memory backup processing in the case where abnormality is detected.
In batch backup of memory areas, when the detection circuit 13 detects abnormality of data which is read out in reading of the data stored in a memory area starting from address 0400H, for example, the CPU 10 issues an alarm based on a detection result of the detection circuit 13 and interrupts the memory backup processing even in the case where the memory area is not used in the numerical controller 1. Therefore, only data from the address 0000H to the address 03FFH are written in the external memory 2 and thus, such problem occurs that normal backup is not performed due to an unused memory area.